package router

import (
	global "yundata-service/internal"
	passport "yundata-service/pkg/api/passport"

	"github.com/gin-gonic/gin"
)

func InitPassportRouter(e *gin.Engine) {

	loginAction := passport.LoginAction{}
	loginAction.ActionModel = global.ActionModel{}
	e.Use(ActionMiddleware(&loginAction.ActionModel))

	passportRouterGroup := e.Group("/api/v1/auth", func(ctx *gin.Context) {})
	{
		passportRouterGroup.POST("/login", func(ctx *gin.Context) {
			loginAction.DoLogin()
		})

		passportRouterGroup.GET("/captcha", func(ctx *gin.Context) {
			loginAction.Captcha()
		})
	}

}
